package com.example.kotlincomponent

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.example.utils.BaseActivity
import kotlinx.android.synthetic.main.activity_dialog.*
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : BaseActivity() , View.OnClickListener {
    private  val TAG = "MainActivity"
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        btn_main_test2.setOnClickListener {
            startActivity(Intent(this,MenuActivity::class.java))
        }
        btn_main_test3.setOnClickListener(this)
        btn_main_test4.setOnClickListener(this)
        btn_main_test5.setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        when(v?.id){
            R.id.btn_main_test3->{
                startActivity(Intent(this,ProgressActivity::class.java))
            }
            R.id.btn_main_test4->{
                startActivity(Intent(this,DialogActivity::class.java))
            }

            R.id.btn_main_test5->{
                startActivity(Intent(this,PopupWindowActivity::class.java))
            }
        }
    }

}



